//
//  LogoutCell.m
//  LiveStar
//
//  Created by 漪珊 on 2017/2/3.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "LogoutCell.h"

@implementation LogoutCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setUpUI];
        self.backgroundColor = [UIColor colorWithHexString:@"F5F5F5"];
    }
    return self;
}


- (void)setUpUI {
    UIButton *logOutBtn = [[UIButton alloc] init];
    logOutBtn.backgroundColor = [UIColor whiteColor];
    logOutBtn.titleLabel.font = UIFont(16);
    [logOutBtn setTitle:@"退出登录" forState:UIControlStateNormal];
    [logOutBtn setTitleColor:[UIColor colorWithHexString:@"666666"] forState:UIControlStateNormal];
    [logOutBtn addTarget:self action:@selector(LogOut:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:logOutBtn];
    [logOutBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(32);
        make.bottom.equalTo(self.contentView);
        make.left.equalTo(self.contentView);
        make.right.equalTo(self.contentView);
    }];
}

- (void)LogOut:(UIButton *)sender {
    [self.delegate logout];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
